home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr10 / inter35c.zip / RB2NG102.ZIP / RB2NG.PAS < prev   
Pascal/Delphi Source File  |  1993-04-18  |  21KB  |  833 lines

  1. {
  2.  
  3.                                                       ╔══════════════════╗
  4.                                                       ║  Ralf Brown's NG ║
  5.                                                       ║  Interrupt List  ║
  6.                                                       ║    Rev. 1.02     ║
  7.                                                       ╚══════════════════╝
  8.  
  9. }
  10.  
  11. Program RBNG;
  12.  
  13. {$F-} {$O-} {$A+} {$G-}
  14. {$V-} {$B-} {$X-} {$N+} {$E+}
  15.  
  16. {$I FINAL.PAS}
  17.  
  18. {$IFDEF FINAL}
  19.   {$I-} {$R-}
  20.   {$D-} {$L-} {$S-}
  21.   {$M 8192,0,0}
  22. {$ENDIF}
  23.  
  24. Uses CRT,Strings;
  25.  
  26. Type
  27.   ConvertType = Array [1..100] of
  28.                 Record
  29.                   IfThis  :String[10];
  30.                   ThenThis:String[10];
  31.                 End;
  32.  
  33. Var
  34.   BatchJob,
  35.   MenuLink,
  36.   F,G          :Text;
  37.   L            :String;
  38.   SeeAlsoLine  :String;
  39.  
  40.   IntFiles     :Array[0..255] of String[12];
  41.  
  42. Procedure Pad(Total,WithChar:Byte);
  43.  
  44. Begin
  45.   For Total:=1 to Total do      {As many times as requested}
  46.       Write(Chr(WithChar));     {write the char}
  47. End;  {Pad}
  48.  
  49. Procedure EditString(X,Y,MaxLets:Byte;Upper:Boolean;Var MainStr:String);
  50.  
  51. Var
  52.   Ins             :Boolean;   {Boolean for the Insert Key Status}
  53.   C               :Char;      {Current Character}
  54.   CurXPos,
  55.   Count           :Byte;      {Number Of Chars In String}
  56.  
  57. Begin
  58.   Ins:=False;                {The Insert key has not yet been pressed}
  59.   CurXPos:=1;                {Current Relative X Position+1}
  60.   GotoXY(X,Y);
  61.   UnPadVar(MainStr,MainStr);
  62.   If Length(MainStr)>MaxLets Then
  63.     MainStr:=Copy(MainStr,1,MaxLets);
  64.   Write(MainStr);
  65.   Pad(MaxLets-Length(MainStr),32);
  66.   Count:=Length(MainStr)+1;  {How many letters in the string+1}
  67.  
  68.   Repeat                     {Repeat Until [Return] is Pressed}
  69.     GotoXY(X+CurXPos-1,Y);   {Goto the Requested Area}
  70.     If Upper Then
  71.       C:=UpCase(ReadKey)
  72.     Else
  73.       C:=ReadKey;
  74.  
  75.     If C=Chr(0) Then         {Check for a cursor key}
  76.     Begin
  77.       C:=ReadKey;            {Which cursor key}         {Numeric Keypad Value}
  78.       If (C='O') Then CurXPos:=Count;                            {1}
  79.       If (C='P') And (CurXPos>=3) Then Dec(CurXPos,2);           {2}
  80.       If (C='Q') And (CurXPos>=4) Then Dec(CurXPos,3);           {3}
  81.       If (C='K') And (CurXPos>1) Then Dec(CurXPos);              {4}
  82.       If (C='M') And (CurXPos<Count) Then Inc(CurXPos);          {6}
  83.       If (C='G') Then CurXPos:=1;                                {7}
  84.       If (C='H') And (CurXPos<=Count-2) Then Inc(CurXPos,2);     {8}
  85.       If (C='I') And (CurXPos<=Count-3) Then Inc(CurXPos,3);     {9}
  86.       If (C=#7 ) Then MainStr[0]:=Chr(CurXPos-1);                {Shift-Del}
  87.       If (C='S') And (Count>1) Then                              {Del}
  88.       Begin
  89.         Delete(MainStr,CurXPos,1);
  90.         GotoXY(X,Y);
  91.         Write(MainStr,' ');
  92.         Dec(Count);
  93.         GotoXY(X-1+CurXPos,Y);
  94.       End;
  95.       If (C='R') Then                                            {Ins}
  96.       Begin
  97.         Ins:=Not Ins;
  98.       End;
  99.       GotoXY(X-1+CurXPos,Y);
  100.     End  {End Extended Key}
  101.     Else
  102.     Begin
  103.  
  104.       If (C=#17) Then                           {^Q}
  105.       Begin
  106.         C:=ReadKey;
  107.         If C=#0 Then
  108.           C:=ReadKey
  109.         Else
  110.         If C in ['y','Y',#25] Then
  111.         Begin
  112.           MainStr[0]:=Chr(CurXPos-1);
  113.           Count:=CurXPos;
  114.           GotoXY(X,Y);
  115.           Write(MainStr);
  116.           Pad(MaxLets-Length(MainStr),32);
  117.         End;
  118.       End
  119.       Else
  120.       If (C=#27) Then
  121.       Begin
  122.         GotoXY(X,Y);
  123.         Pad(MaxLets,32);
  124.         MainStr:='';
  125.         C:=#13;
  126.       End
  127.       Else
  128.       If (C=#8) Then                     {Was BackSpace Presssed?}
  129.       Begin
  130.         If (CurXPos>1) Then              {Can I BackSpace?}
  131.         Begin
  132.           Delete(MainStr,CurXPos-1,1);   {Delete the char}
  133.           GotoXY(X,Y);
  134.           Write(MainStr,' ');            {Redisplay the String}
  135.           Dec(Count);                    {One less char}
  136.           Dec(CurXPos);                  {Move Back}
  137.           GotoXY(X-1+CurXPos,Y);         {Goto Position}
  138.         End;                             {End 'Can I BackSpace?'}
  139.       End                                {End 'Was BackSpace Pressed?'}
  140.       Else                               {No Not BackSpace - A Normal Letter}
  141.         If (CurXPos<=MaxLets) And (C<>#13) Then    {Is there Space?}
  142.         Begin
  143.           If Ins Or (CurXPos>=Count) Then   {Must I Insert the Char?}
  144.           Begin
  145.             If Count<=MaxLets Then
  146.               Begin
  147.                 Insert(C,MainStr,CurXPos);  {Insert the Char}
  148.                 Inc(Count);                 {Add 1 to Count}
  149.                 Inc(CurXPos);               {Move Cursor}
  150.               End;                          {End Check for Space in String}
  151.           End                               {End Check to see if Ins was True}
  152.           Else                              {No, Do not Insert, Overwrite}
  153.           Begin
  154.             MainStr[CurXPos]:=C;      {Overwrite char}
  155.             Inc(CurXPos);             {Move Cursor}
  156.           End;                        {End Insert / Overwrite}
  157.  
  158.           If CurXPos<Count Then       {If the char was Inserted, Rewrite}
  159.           Begin                       {the entire String to the screen}
  160.             GotoXY(X,Y);
  161.             Write(MainStr);
  162.             GotoXY(X-1+CurXPos,Y);
  163.           End                         {End Rewrite the String to the screen}
  164.           Else                        {Need Not Rewrite the entire String}
  165.              Write(C);                {Just Display the new char}
  166.         End;
  167.     End;                              {End Area which accepts a BackSpace or a Letter}
  168.   Until C=#13;
  169.  
  170.   UnPadVar(MainStr,MainStr);
  171. End;
  172.  
  173. Function HexToDec(Hex:String):Word;
  174.  
  175. Var
  176.   Temp  :Word;
  177.  
  178. Begin
  179.   Temp:=0;
  180.   UpperCase(Hex,Hex);
  181.   If Hex[1] in ['0'..'9'] Then Temp:=Temp + (Ord(Hex[1])-Ord('0'))*16;
  182.   If Hex[1] in ['A'..'F'] Then Temp:=Temp + (Ord(Hex[1])-Ord('A')+10)*16;
  183.   If Hex[2] in ['0'..'9'] Then Temp:=Temp +  Ord(Hex[2])-Ord('0');
  184.   If Hex[2] in ['A'..'F'] Then Temp:=Temp +  Ord(Hex[2])-Ord('A')+10;
  185.   HexToDec:=Temp;
  186. End;
  187.  
  188. Procedure CheckIntNumber(Var L:String;Var NewNumber:Boolean;
  189.                          Var IntComment:String;Var IntCount:Word);
  190.  
  191. Const
  192.   LastInt :Word = 65000;
  193.  
  194. Var
  195.   DecStr  :String[4];
  196.   DecNum  :Word;
  197.  
  198. Begin
  199.   NewNumber:=False;
  200.   IntComment:='';
  201.   If Copy(L,1,4)='Int ' Then
  202.   Begin
  203.     Inc(IntCount);
  204.     L[6]:=UpCase(L[6]);
  205.     L[7]:=UpCase(L[7]);
  206.     L[8]:=UpCase(L[8]);
  207.     L[9]:=UpCase(L[9]);
  208.     DecNum:=HexToDec(Copy(L,5,2));
  209.     If (DecNum<>LastInt) And (DecNum<=240) And ((DecNum>=10) Or (DecNum=0)) Then
  210.     Begin
  211.       IntCount:=1;
  212.       LastInt:=DecNum;
  213.       Str(DecNum:3,DecStr);
  214.       IntComment:='Interrupt '+Copy(L,5,2)+'h'+'  ('+DecStr+')';
  215.       If DecNum=240 Then IntComment:=IntComment+' ^Bto^B FFh  (255)';
  216.       If DecNum=  0 Then IntComment:=IntComment+' ^Bto^B 09h  (  9)';
  217.       NewNumber:=True;
  218.     End;
  219.     If (DecNum>240) Or ((DecNum<10) And (DecNum<>0)) Then IntComment:='$$NO$$';
  220.   End;
  221.   If Copy(L,1,19)='Please Redistribute' Then
  222.   Begin
  223.     IntComment:='Final Comments From Ralf';
  224.     NewNumber:=True;
  225.   End;
  226. End;
  227.  
  228. Function NGOFName(FName:String):String;
  229. Begin
  230.   NGOFName:=Copy(FName,1,Pos('.',FName))+'NGO';
  231. End;
  232.  
  233. Procedure NewMenuItem(Comment,FName:String);
  234. Begin
  235.   WriteLn(MenuLink,'   '+Comment+'  '+NGOFName(FName));
  236. End;
  237.  
  238. Procedure NewBatchItem(Command:String);
  239. Begin
  240.   WriteLn(BatchJob,Command);
  241. End;
  242.  
  243. Function NextOutputFileName:String;
  244.  
  245. Const
  246.   Total   :Word = 0;
  247.  
  248. Var
  249.   Temp  :String[3];
  250.  
  251. Begin
  252.   Inc(Total);
  253.   Str(Total,Temp);
  254.   FormatVar(Temp,Temp,3,RightText);
  255.   SpacesToZeros(Temp,Temp);
  256.   NextOutputFileName:='RB'+Temp+'.';
  257. End;
  258.  
  259. Procedure I(Var S:String);
  260. Begin
  261.   ReadLn(F,S);
  262. End;
  263.  
  264. Procedure O(S:String);
  265. Begin
  266.   WriteLn(G,S);
  267. End;
  268.  
  269. Procedure OLn;
  270. Begin
  271.   WriteLn(G);
  272. End;
  273.  
  274. Procedure BoldEtc(StIn:String;Var StOut:String);
  275.  
  276. Var
  277.   SpPos:Byte;
  278.  
  279. Begin
  280.   StOut:=StIn;
  281.  
  282.   SpPos:=Pos('Desc:',StOut);
  283.   If SpPos>0 Then
  284.   Begin
  285.     Delete(StOut,SpPos,5);
  286.     Insert('^BDesc:^B',StOut,SpPos);
  287.   End;
  288.  
  289.   SpPos:=Pos('Note:',StOut);
  290.   If SpPos>0 Then
  291.   Begin
  292.     OLn;
  293.     Delete(StOut,SpPos,5);
  294.     Insert('^BNote:^B',StOut,SpPos);
  295.   End;
  296.  
  297.   SpPos:=Pos('SeeAlso:',StOut);
  298.   If SpPos>0 Then
  299.   Begin
  300.     OLn;
  301.     Delete(StOut,SpPos,8);
  302.     Insert('^BSee Also:^B',StOut,SpPos);
  303.   End;
  304.  
  305.   SpPos:=Pos('Return:',StOut);
  306.   If SpPos>0 Then
  307.   Begin
  308.     OLn;
  309.     Delete(StOut,SpPos,7);
  310.     Insert('^BReturn:^B',StOut,SpPos);
  311.   End;
  312.  
  313.   SpPos:=Pos('Notes:',StOut);
  314.   If SpPos>0 Then
  315.   Begin
  316.     OLn;
  317.     Delete(StOut,SpPos,6);
  318.     Insert('^BNotes:^B',StOut,SpPos);
  319.   End;
  320. End;
  321.  
  322. Procedure TabTo(StIn:String;Var StOut:String;TabSize:Byte);
  323.  
  324. Var
  325.   SpPos:Byte;
  326.   Spc  :String;
  327.  
  328. Begin
  329.   StOut:=StIn;
  330.  
  331.   Repeat
  332.     SpPos:=Pos(#9,StOut);
  333.     If SpPos>0 Then
  334.     Begin
  335.       Delete(StOut,SpPos,1);
  336.       PadVar('',Spc,TabSize - (SpPos Mod TabSize));
  337.       Insert(Spc,StOut,SpPos);
  338.     End;
  339.   Until SpPos=0;
  340. End;
  341.  
  342. Procedure LoadConvertList(FromFile:String;Var CList:ConvertType);
  343.  
  344. Var
  345.   F     :Text;
  346.   Cnt   :Word;
  347.   St    :String;
  348.   SpPos :Byte;
  349.  
  350. Begin
  351.   FillChar(CList,SizeOf(CList),0);
  352.   Cnt:=0;
  353.   Assign(F,FromFile);
  354.   {$I-}
  355.   Reset(F);
  356.   {$IFNDEF FINAL} {$I+} {$ENDIF}
  357.   If IOResult>0 Then Exit;
  358.   While (Not EOF(F)) And (Cnt<99) do
  359.   Begin
  360.     Inc(Cnt);
  361.     ReadLn(F,St);
  362.     SpPos:=Pos('|',St);
  363.     If SpPos>0 Then
  364.     Begin
  365.       If SpPos>11 Then SpPos:=11;
  366.       CList[Cnt].IfThis:=Copy(St,1,SpPos-1);
  367.       Delete(St,1,SpPos);
  368.       CList[Cnt].ThenThis:=Copy(St,1,10);
  369.     End;
  370.   End;
  371.   Close(F);
  372. End;
  373. {
  374. Procedure BufferSeeAlsoComments(St:String);
  375.  
  376. Var
  377.   SpPos   :Byte;
  378.  
  379. Begin
  380.   If Copy(St,1,13)='^BSee Also:^B' Then
  381.   Begin
  382.     If SeeAlsoLine='' Then SeeAlsoLine:='!SeeAlso:';
  383.     Delete(L,1,13);
  384.     UnPadVar(St,St);
  385.     While St<>'' do
  386.     Begin
  387.       SpPos:=Pos('INT ',St);
  388.       If SpPos>0 Then
  389.       Begin
  390.         If (Length(SeeAlsoLine)<240) Then
  391.           SeeAlsoLine:=SeeAlsoLine+' "'+Copy(St,SpPos,6)+'"';
  392.         SpPos:=Pos(',',St);
  393.         If SpPos>0 Then
  394.           Delete(St,1,SpPos)
  395.         Else
  396.           St:='';
  397.       End
  398.       Else
  399.         St:='';
  400.     End;
  401.   End;
  402. End;
  403.  
  404. Procedure FlushSeeAlsoComments;
  405. Begin
  406.   If SeeAlsoLine<>'' Then
  407.   Begin
  408.     O(SeeAlsoLine);
  409.     SeeAlsoLine:='';
  410.   End;
  411. End;
  412. }
  413. Const
  414.   TabSize       = 4;
  415.   ConvertFile   = 'CONVERT.TXT';
  416.   MainRBFile    = 'RBINT';
  417.   BatchFile     = 'CRB.BAT';
  418.   NGC           = 'CALL NGC';
  419.   NGML          = 'CALL NGML';
  420.  
  421. Var
  422.   IntCount      :Word;
  423.   Cnt           :LongInt;
  424.   CodeLetter,
  425.   C             :Char;
  426.   TempLine,
  427.   LastIntComment,
  428.   IntComment    :String;
  429.   RBDir         :String;
  430.   OutDir        :String;
  431.   NewNumber     :Boolean;
  432.   IntLetter     :Char;
  433.   IntListFile,
  434.   FName         :String[12];
  435.   LongCount     :Word;
  436.   CList         :ConvertType;
  437.   StopProc      :Boolean;
  438.  
  439. Procedure CapWords(StIn:String;Var StOut:String);
  440.  
  441. Var
  442.   X      :Word;
  443.   SpPos  :Byte;
  444.  
  445. Begin
  446.   Strings.CapWords(StIn,StOut);
  447.   X:=1;
  448.   While CList[X].IfThis<>'' do
  449.   Begin
  450.     SpPos:=Pos(CList[X].IfThis,StOut);
  451.     If SpPos>0 Then
  452.     Begin
  453.       Delete(StOut,SpPos,Length(CList[X].IfThis));
  454.       Insert(CList[X].ThenThis,StOut,SpPos);
  455.     End;
  456.     Inc(X);
  457.   End;
  458. End;
  459.  
  460. Begin
  461.   SeeAlsoLine:='';
  462.  
  463.   RBDir:='';
  464.   OutDir:='';
  465.   StopProc:=False;
  466.   IntLetter:='A';
  467.  
  468.   ClrScr;
  469.   WriteLn('Ralf Brown''s Text Format to .NG Format       Version  1.02');
  470.   WriteLn('Copyright (c) Michael Gallias, 1992');
  471.   WriteLn;
  472.   WriteLn('Note that this program does NOT convert directly to .NG format, it converts');
  473.   WriteLn('the files to a new text format so that they can be compiled with the Norton');
  474.   WriteLn('Guides Compiler.  You thus require the Norton Guides Compiler to convert the');
  475.   WriteLn('files.  If you do not have this program, Ralf''s list is available in .NG');
  476.   WriteLn('format already.  It should be at the same FTP site where you obtained this');
  477.   WriteLn('file.');
  478.   WriteLn;
  479.   WriteLn('Also note that the process requires 10 megabytes of free disk space.');
  480.   WriteLn('The program will run about 10 times faster if you use the SmartDrv write cache.');
  481.   WriteLn('For further details, please see the documentation.');
  482.   WriteLn;
  483.   WriteLn('If you don''t want the glossary or the low memory usage, delete the files');
  484.   WriteLn('GLOSSARY.LST and MEMORY.LST before running this program and they will not');
  485.   WriteLn('be included in the .NG.');
  486.   WriteLn;
  487.   WriteLn('This program has only been tested on release 34 files.');
  488.   WriteLn;
  489.   Write('Do you want to continue  (Y)es (N)o  ?');
  490.   C:=UpCase(ReadKey);
  491.   If C<>'Y' Then Halt;
  492.   ClrScr;
  493.  
  494.   WriteLn('Specify the directory where this program and the original text files');
  495.   WriteLn('are to be found.');
  496.   WriteLn;
  497.   EditString(1,WhereY,60,True,RBDir);
  498.   If Length(RBDir)>2 Then
  499.     If RBDir[Length(RBDir)]<>'\' Then RBDir:=RBDir+'\';
  500.   WriteLn;
  501.   WriteLn;
  502.   WriteLn;
  503.   WriteLn('Specify the output directory for the new text files which need compiling.');
  504.   WriteLn;
  505.   EditString(1,WhereY,60,True,OutDir);
  506.   If Length(OutDir)>2 Then
  507.     If OutDir[Length(OutDir)]<>'\' Then OutDir:=OutDir+'\';
  508.   WriteLn;
  509.   WriteLn;
  510.   WriteLn('Press any key to start the process or [Esc] to quit to DOS.');
  511.   C:=ReadKey;
  512.   If C=#27 Then Halt;
  513.   ClrScr;
  514.   WriteLn('Converting Ralf''s list:');
  515.   WriteLn;
  516.  
  517.   LoadConvertList(RBDir+ConvertFile,CList);
  518.  
  519.   Assign(MenuLink,OutDir+MainRBFile);
  520.   Rewrite(MenuLink);
  521.   WriteLn(MenuLink,'!Name: Ralf Brown');
  522.   WriteLn(MenuLink,'!Credits: Ralf Brown''s Interrupt List Converted by Michael Gallias');
  523.   WriteLn(MenuLink,'!Menu: Lists');
  524.  
  525.   Assign(BatchJob,OutDir+BatchFile);
  526.   Rewrite(BatchJob);
  527.   WriteLn(BatchJob,'@Echo Off');
  528.  
  529.   Assign(F,RBDir+'INTERRUP.'+IntLetter);
  530.   Reset(F);
  531.  
  532.   FName:=NextOutputFileName;
  533.   NewBatchItem(NGC+' '+FName);
  534.   NewMenuItem('Comments',FName);
  535.   Assign(G,OutDir+FName);
  536.   Rewrite(G);
  537.  
  538.   O('!Short: Credits');
  539.   OLn;
  540.   O('^UCredits^U');
  541.   OLn;
  542.   Repeat
  543.     I(L);
  544.     If Copy(L,1,5)<>'-----' Then O(L);
  545.   Until Copy(L,1,5)='-----';
  546.   OLn;
  547.   O('This list was converted from the released text format to the');
  548.   O('Norton Guides / Expert Help Popup format by Michael Gallias.');
  549.   OLn;
  550.   O('Michael Gallias');
  551.   O('P O Box 22106');
  552.   O('Glenashley');
  553.   O('4022');
  554.   O('South Africa');
  555.   OLn;
  556.   O('gallias@ph.und.ac.za');
  557.   O('isapeg@images.cs.und.ac.za');
  558.   OLn;
  559.   O('For information on more shareware, send a blank message to the');
  560.   O('computer at icarus@ph.und.ac.za and it will reply to you.');
  561.   OLn;
  562.  
  563.   Cnt:=1;
  564.   Repeat
  565.     Str(Cnt,L);
  566.     L:='Ralf''s Comment '+L;
  567.     O('!Short: '+L);
  568.     OLn;
  569.     O('^U'+L+'^U');
  570.     OLn;
  571.     Repeat
  572.       I(L);
  573.       If Copy(L,1,5)<>'-----' Then O(L);
  574.     Until Copy(L,1,5)='-----';
  575.     OLn;
  576.     Inc(Cnt);
  577.     CodeLetter:=L[9];
  578.     Delete(L,1,10);
  579.   Until L='00---------------------------------';
  580.  
  581.   Close(G);
  582.  
  583.   FName:=NextOutputFileName;
  584.   NewMenuItem('Interrupts',FName);
  585.   IntListFile:=FName;
  586.   Assign(G,OutDir+IntListFile);
  587.   Rewrite(G);
  588.   OLn;
  589.   NewBatchItem(NGC+' '+IntListFile);
  590.   WriteLn;
  591.  
  592.   Cnt:=1;
  593.   IntCount:=1;
  594.   Repeat
  595.     I(L);
  596.     If Copy(L,1,3)='INT' Then
  597.     Begin
  598.       TempLine:=Copy(L,1,Pos('-',L));
  599.       TempLine[2]:='n';
  600.       TempLine[3]:='t';
  601.       Delete(L,1,Pos('-',L));
  602.       LowerCase(L,L);
  603.       CapWords(L,L);
  604.       L:=TempLine+L;
  605.     End
  606.     Else
  607.     Begin
  608.       LowerCase(L,L);
  609.       CapWords(L,L);
  610.     End;
  611.  
  612.     CheckIntNumber(L,NewNumber,IntComment,IntCount);
  613.  
  614.     If (NewNumber) And (IntComment<>'$$NO$$') Then
  615.     Begin
  616.       LastIntComment:=IntComment;
  617.       Close(G);
  618.       Assign(G,OutDir+IntListFile);
  619.       Append(G);
  620.       FName:=NextOutputFileName;
  621.       O('!Short: '+IntComment);
  622.       O('!File:'+NGOFName(FName));
  623.       OLn;
  624.       Close(G);
  625.       NewBatchItem(NGC+' '+FName);
  626.       Assign(G,OutDir+FName);
  627.       Rewrite(G);
  628.     End;
  629.  
  630.     If IntCount>230 Then
  631.     Begin
  632.       IntCount:=1;
  633.       Close(G);
  634.       Assign(G,OutDir+IntListFile);
  635.       Append(G);
  636.       FName:=NextOutputFileName;
  637.       O('!Short: '+LastIntComment+'  ^B(Cont.)^B');
  638.       O('!File:'+NGOFName(FName));
  639.       OLn;
  640.       Close(G);
  641.       NewBatchItem(NGC+' '+FName);
  642.       Assign(G,OutDir+FName);
  643.       Rewrite(G);
  644.     End;
  645.  
  646.     GotoXY(1,WhereY-1);
  647.     Write('                                                                               ');
  648.     GotoXY(1,WhereY);
  649.     WriteLn(Cnt,' ',Copy(L,1,60));
  650.     O('!Short: '+Copy(L,1,76));
  651.     OLn;
  652.     If Copy(L,1,3)='Int' Then
  653.     Begin
  654.       TempLine:=Copy(L,1,73);
  655.       FormatVar(TempLine,TempLine,73,LeftText);
  656.       TempLine:='^U'+TempLine+'^U  [^B'+CodeLetter+'^B]';
  657.     End
  658.     Else
  659.       TempLine:='^U'+Copy(L,1,76)+'^U';
  660.     O(TempLine);
  661.     OLn;
  662.     IntComment:=L;
  663.     LongCount:=0;
  664.     Repeat
  665.       I(L);
  666.       BoldEtc(L,L);
  667.       TabTo(L,L,TabSize);
  668.       Inc(LongCount,Length(L));
  669.  
  670.       If (LongCount>11500) And (Copy(L,1,5)<>'-----') Then
  671.       Begin
  672.         Inc(IntCount);
  673.         LongCount:=0;
  674.         OLn;
  675.         O('^B.NG limit reached, continued in next section...^B');
  676.         OLn;
  677.         O('!Short: '+IntComment+'  ^B(Cont.)^B');
  678.         OLn;
  679.         O('^U'+IntComment+'^B   (Cont.)');
  680.         OLn;
  681.       End;
  682.  
  683.       If Copy(L,1,5)<>'-----' Then
  684. {      Begin}
  685.         O(L);
  686. {        BufferSeeAlsoComments(L);
  687.       End
  688.       Else
  689.         FlushSeeAlsoComments;}  {Can't see ahead to determine which file to reference}
  690.  
  691.     Until (Copy(L,1,5)='-----') Or (EOF(F));
  692.     CodeLetter:=L[9];
  693.     OLn;
  694.     Inc(Cnt);
  695.  
  696.     If EOF(F) Then
  697.     Begin
  698.       Close(F);
  699.       IntLetter:=Chr(Ord(IntLetter)+1);
  700.       Assign(F,RBDir+'INTERRUP.'+IntLetter);
  701.       {$I-}
  702.       Reset(F);
  703.       {$IFNDEF FINAL} {$I+} {$ENDIF}
  704.       If IOResult=0 Then
  705.       Begin
  706.         ReadLn(F);
  707.         ReadLn(F);
  708.         ReadLn(F);
  709.       End
  710.       Else
  711.         StopProc:=True;
  712.     End;
  713.  
  714.   Until StopProc;
  715.  
  716.   Close(G);
  717.  
  718.   {End Interrupts}
  719.  
  720.   {Check For Glossary}
  721.  
  722.   Assign(F,RBDir+'GLOSSARY.LST');
  723.   {$I-}
  724.   Reset(F);
  725.   {$IFNDEF FINAL} {$I+} {$ENDIF}
  726.   If IOResult=0 Then
  727.   Begin
  728.     I(L);
  729.     I(L);
  730.     I(L);
  731.     I(L);
  732.     Cnt:=1;
  733.     FName:=NextOutputFileName;
  734.     NewMenuItem('Glossary',FName);
  735.     IntListFile:=FName;
  736.     Assign(G,OutDir+IntListFile);
  737.     Rewrite(G);
  738.     OLn;
  739.     NewBatchItem(NGC+' '+IntListFile);
  740.  
  741.     Repeat
  742.       GotoXY(1,WhereY-1);
  743.       Write('                                                                               ');
  744.       GotoXY(1,WhereY);
  745.       WriteLn(Cnt,' ',Copy(L,1,60));
  746.       O('!Short: '+Copy(L,1,76));
  747.       OLn;
  748.       TempLine:='^U'+Copy(L,1,76)+'^U';
  749.       O(TempLine);
  750.       OLn;
  751.       Repeat
  752.         I(L);
  753.         BoldEtc(L,L);
  754.         TabTo(L,L,TabSize);
  755.         If L<>'' Then O(L);
  756.       Until (L='') Or (EOF(F));
  757.       OLn;
  758.       If Not EOF(F) Then I(L);
  759.       Inc(Cnt);
  760.     Until EOF(F);
  761.  
  762.     Close(F);
  763.     Close(G);
  764.   End;
  765.  
  766.   {End Check For Glossary}
  767.  
  768.   {Check For Low Memory}
  769.  
  770.   Assign(F,RBDir+'MEMORY.LST');
  771.   {$I-}
  772.   Reset(F);
  773.   {$IFNDEF FINAL} {$I+} {$ENDIF}
  774.   If IOResult=0 Then
  775.   Begin
  776.     I(L);
  777.     I(L);
  778.     I(L);
  779.     I(L);
  780.     Cnt:=1;
  781.     FName:=NextOutputFileName;
  782.     NewMenuItem('Memory',FName);
  783.     IntListFile:=FName;
  784.     Assign(G,OutDir+IntListFile);
  785.     Rewrite(G);
  786.     OLn;
  787.     NewBatchItem(NGC+' '+IntListFile);
  788.  
  789.     Repeat
  790.       GotoXY(1,WhereY-1);
  791.       Write('                                                                               ');
  792.       GotoXY(1,WhereY);
  793.       If (L[Length(L)]=':') Then Delete(L,Length(L),1);
  794.       WriteLn(Cnt,' ',Copy(L,1,60));
  795.       O('!Short: '+Copy(L,1,76));
  796.       OLn;
  797.       TempLine:='^U'+Copy(L,1,76)+'^U';
  798.       O(TempLine);
  799.       OLn;
  800.       I(L);
  801.       Repeat
  802.         BoldEtc(L,L);
  803.         TabTo(L,L,TabSize);
  804.         If L<>'' Then O(L);
  805.         If Not EOF(F) Then I(L);
  806.       Until (Copy(L,1,9)='Format of') Or (EOF(F));
  807.       OLn;
  808.       Inc(Cnt);
  809.     Until EOF(F);
  810.  
  811.     Close(F);
  812.     Close(G);
  813.   End;
  814.  
  815.   {End Check For Low Memory}
  816.  
  817.  
  818.   NewBatchItem(NGML+' '+MainRBFile);
  819.  
  820.   Close(MenuLink);
  821.   Close(BatchJob);
  822.  
  823.   ClrScr;
  824.   WriteLn('Complete.');
  825.   WriteLn;
  826.   WriteLn('Now, go to the output directory and type CRB to compile the database.');
  827.   WriteLn('The database will be around 2.5 megabytes when complete.');
  828.   WriteLn;
  829.   WriteLn('Make sure the NGC (Norton Guides Compiler) and the NGML (Norton Guides');
  830.   WriteLn('Menu Linker) programs are on the path (or setup a batch file).');
  831.   WriteLn;
  832. End.
  833.